﻿@model Eqwww.Domain.Models.SystemSecurity.DbBackupModel


@{
    ViewData["Title"] = "数据备份";
    Layout = "~/Views/Shared/_ManageFormLayout.cshtml";
}
@{
    var filename = DateTime.Now.ToString("yyyyMMddhhmmss");
    filename = ViewBag.DbName + "_" + filename;
}

<form id="form1" class="mdui-m-t-3 mdui-m-b-3">
    <div asp-validation-summary="ModelOnly" class="mdui-textfield-error"></div>
    <input type="hidden" asp-for="DbName" value="@ViewBag.DbName" />
    <div class="mdui-container">

        <div class="mdui-row">

            <div class="mdui-col-xs-12 mdui-col-md-6">
                <div class="mdui-typo mdui-color-yellow-100 mdui-p-a-2 " style="border-radius:5px;">
                    <p class=""><i class="mdui-icon material-icons">info_outline</i> 本操作将数据备份到服务器，请在操作完成后将备份文件下载到本地存档。</p>
                </div>
            </div>


            <div class="mdui-col-xs-12 mdui-col-md-6">

                <div class="mdui-textfield mdui-textfield-floating-label">
                    <label asp-for="FileName" class="mdui-textfield-label"></label>
                    <input asp-for="FileName" value="@filename" class="mdui-textfield-input mdui-color-grey-100" />
                    <span asp-validation-for="FileName" class="mdui-textfield-error"></span>
                </div>
            </div>




        </div>

    </div>
</form>


@section Scripts {
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}

    <script>
        function submitForm() {
            if (!$("#form1").valid()) {
                return false;
            }
            var postData = $('#form1').formSerialize();
            $.submitForm({
                url: "/SystemSecurity/DbBackup/CreateSubmit",
                param: postData,
                success: function () {
                    $.currentWindow().location.reload();
                }
            });

        };
    </script>
}
